home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / MORGUL15.422 < prev    next >
Text File  |  1993-04-08  |  8KB  |  322 lines

  1. Morgul15.mod - Improved Macro list/editor for Defaults
  2. Morgul #1 @8315
  3. 1Sunday, 2April 34, 51993 7@ 1 46:120 7am 2EST
  4.  
  5.  
  6. ┌────────────────────────────────────────────────────────────────────────────┐
  7. │ Mod Name: Morg15.Mod       Mod Authors: Morgul 1@8315                      │
  8. │ Difficulty: Pretty simple!        Date: April 4, 1993 @ 4 am!              │
  9. │ WWIV Version: 4.22                                                         │
  10. │ Files Affected: Defaults.c, Fcns.c                                         │
  11. │ Description: This is a MUCH better looking way of listing and editing your │
  12. │              macros.                                                       │
  13. └────────────────────────────────────────────────────────────────────────────┘
  14.  
  15.     Actually, I saw this type of thing on another board in town at one time.
  16. It was a similar mod, but mine is faster and cleaner, I believe.  I got the
  17. idea to write it up and publish it, since the original author wasn't (it'd been
  18. about 5 months since I last saw it.)  Anyway, thanks to Dungeon Master 1@8327
  19. who gave me the idea.
  20.  
  21.     Now, on with the mod.
  22.  
  23. << Step 1 >> BACK UP YOUR SOURCE!
  24.  
  25. << Step 2 >> Load up DEFAULTS.C and look for void list_macro.  Immediately
  26. above it, add the following voids:
  27.  
  28. void show_macro(void)
  29. {
  30.     int i;
  31.     outchr(12);
  32.     ansic(7);
  33.  
  34.     goxy(1,5);
  35.     outchr(201);
  36.     for (i=0;i<9;i++)
  37.     outchr(205);
  38.     outchr(203);
  39.     for (i=0;i<68;i++)
  40.     outchr(205);
  41.     outchr(187);
  42.     goxy(1,6);
  43.     outchr(186);
  44.     npr("4Control-A");
  45.     ansic(7);
  46.     outchr(186);
  47.     mpl(68);
  48.     goxy(80,6);
  49.     ansic(7);
  50.     outchr(186);
  51.     goxy(1,7);
  52.     outchr(204);
  53.     for(i=0;i<9;i++)
  54.     outchr(205);
  55.     outchr(206);
  56.     for (i=0;i<68;i++)
  57.     outchr(205);
  58.     outchr(186);
  59.     goxy(1,8);
  60.     outchr(186);
  61.     npr("4Control-D");
  62.     ansic(7);
  63.     outchr(186);
  64.     mpl(68);
  65.     goxy(80,8);
  66.     ansic(7);
  67.     outchr(186);
  68.     goxy(1,9);
  69.     outchr(204);
  70.     for(i=0;i<9;i++)
  71.     outchr(205);
  72.     outchr(206);
  73.     for (i=0;i<68;i++)
  74.     outchr(205);
  75.     outchr(186);
  76.     goxy(1,10);
  77.     outchr(186);
  78.     npr("4Control-F");
  79.     ansic(7);
  80.     outchr(186);
  81.     mpl(68);
  82.     goxy(80,10);
  83.     ansic(7);
  84.     outchr(186);
  85.     goxy(1,11);
  86.     outchr(200);
  87.     for(i=0;i<9;i++)
  88.     outchr(205);
  89.     outchr(202);
  90.     for (i=0;i<68;i++)
  91.     outchr(205);
  92.     outchr(188);
  93.     goxy(12,6);
  94.     ansic(4);
  95.     list_macro(&(thisuser.macros[2][0]));
  96.     goxy(12,8);
  97.     ansic(4);
  98.     list_macro(&(thisuser.macros[0][0]));
  99.     goxy(12,10);
  100.     ansic(4);
  101.     list_macro(&(thisuser.macros[1][0]));
  102. }
  103.  
  104. void do_macros(void)
  105. {
  106. char ch;
  107. int i,done;
  108. do {
  109.     show_macro();
  110.     goxy(1,14);
  111.     ansic(7);
  112.     outchr(201);
  113.     for (i=0;i<78;i++)
  114.     outchr(205);
  115.     outchr(187);
  116.  
  117.     goxy(1,15);
  118.     outchr(186);
  119.     mpl(78);
  120.     ansic(7);
  121.     goxy(80,15);
  122.     outchr(186);
  123.     goxy(1,16);
  124.     ansic(7);
  125.     outchr(200);
  126.     for (i=0;i<78;i++)
  127.     outchr(205);
  128.     outchr(188);
  129.  
  130.     goxy(2,15);
  131.     npr("4Which Macro do you want to change, A, D, or F (Q to Quit)");
  132.     goxy(60,15);
  133.     ch=onek("ADFQ");
  134.     switch (ch) {
  135.         case 'A':
  136.         make_macro(2);
  137.         done=0;
  138.         break;
  139.         case 'D':
  140.         make_macro(0);
  141.         done=0;
  142.         break;
  143.         case 'F':
  144.         make_macro(1);
  145.         done=0;
  146.         break;
  147.         case 'Q':
  148.         done=1;
  149.         goxy(1,20);
  150.         break;
  151.     }
  152. } while ((!done) && (!hangup));
  153. }
  154.  
  155.  
  156. void make_macro(int type)
  157. {
  158. unsigned char tempmac[81], s[81];
  159. unsigned char ch1;
  160. int y1,i,done,i1,done1;
  161. switch (type)
  162. {
  163.     case 0:
  164.     y1=7;
  165.     i1=0;
  166.     break;
  167.     case 1:
  168.     y1=9;
  169.     i1=1;
  170.     break;
  171.     case 2:
  172.     y1=5;
  173.     i1=2;
  174.     break;
  175. }
  176. goxy(1,y1);
  177. ansic(2);
  178.     outchr(201);
  179.     for (i=0;i<9;i++)
  180.     outchr(205);
  181.     outchr(203);
  182.     for (i=0;i<68;i++)
  183.     outchr(205);
  184.     outchr(187);
  185. goxy(1,y1+1);
  186. outchr(186);
  187. goxy(11,y1+1);
  188. outchr(186);
  189. goxy(80,y1+1);
  190. outchr(186);
  191. goxy(1,y1+2);
  192. outchr(200);
  193. for (i=0;i<9;i++)
  194. outchr(205);
  195. outchr(202);
  196. for (i=0;i<68;i++)
  197. outchr(205);
  198. outchr(188);
  199. goxy(2,15);
  200. mpl(78);
  201. npr("4Please enter your macro now, Control-Z when you are done.");
  202. goxy(12,y1+1);
  203. mpl(68);
  204. strcpy(s,&thisuser.macros[i1][0]);
  205. thisuser.macros[i1][0]=0;
  206. done1=0;
  207. i=0;
  208.           do {
  209.             ch1=getkey();
  210.             if (ch1==26)
  211.               done1=1;
  212.             else
  213.               if (ch1==8) {
  214.                 if (i>0) {
  215.                   i--;
  216.                   backspace();
  217.                   if (tempmac[i]<32)
  218.                     backspace();
  219.                 }
  220.               } else {
  221.                 if (ch1>=32) {
  222.                   tempmac[i++]=ch1;
  223.                   outchr(ch1);
  224.                 } else {
  225.                   tempmac[i++]=ch1;
  226.                   outchr('^');
  227.                   outchr(ch1+64);
  228.                 }
  229.               }
  230.             if (i>=68)
  231.               done1=1;
  232.           } while ((!done1) && (!hangup));
  233. tempmac[i]=0;
  234. goxy(2,15);
  235. mpl(78);
  236. npr("4Is this what you want (Y/N)");
  237. goxy(30,15);
  238.           if (yn()) {
  239.             strcpy(&(thisuser.macros[i1][0]),tempmac);
  240.             goxy(2,15);
  241.             mpl(78);
  242.             npr("4It's Saved!");
  243.           } else {
  244.             strcpy(&(thisuser.macros[i1][0]),s);
  245.             goxy(2,15);
  246.             mpl(78);
  247.             npr("4Throwing it out the window....");
  248.           }
  249.           ansic(0);
  250.  
  251.         }
  252.  
  253. << Step 3 >> Go down to void list_macro, and comment out the lines indicated:
  254.  
  255. void list_macro(unsigned char *s)
  256. {
  257.   int i;
  258.  
  259.   i=0;
  260. //  outchr('\"');  /* Commented out for Morgul15.Mod */
  261.   while ((i<80) && (s[i]!=0)) {
  262.     if (s[i]>=32)
  263.       outchr(s[i]);
  264.     else {
  265.       outchr('^');
  266.       outchr(s[i]+64);
  267.     }
  268.     ++i;
  269.   }
  270. //  outchr('"');  /* Commented out for Morgul15.Mod */
  271.   nl();
  272. }
  273.  
  274. << Step 4 >> Remove completely or comment out void make_macros().  Make sure
  275. you get make macroS, not make_macro, which you just added.  make_macros comes
  276. right after void list_macro
  277.  
  278. << Step 5 >> Step on down to void defaults.  Make the following changes to case
  279. 7
  280.  
  281.       case '7':
  282.         do_macros();      /* Added for Morg15.Mod */
  283.         pausescr();       /* Added for Morg15.Mod */
  284. //        make_macros();  /* Commented out for Morg15.Mod */
  285.         break;
  286.       case '8':
  287.  
  288.  
  289. << Step 6 >> Save Defaults.c and load up FCNS.H  Search for void list_macro and
  290. insert these right above it:
  291.  
  292. void show_macro(void);
  293. void do_macros(void);
  294. void make_macro(int type);
  295.  
  296.     And be sure to delete void make_macros(void) directly underneath void
  297.     list_macro
  298.  
  299. << Step 7 >> Save and compile! That's all there is to it.  It creates an
  300. impressive looking macro section in defaults...you've got to see it to believe
  301. it.  The only drawback to this mod is that it shortens the length of the macro
  302. to 68 characters...unfortunate, but really unavoidible to have it fit in the
  303. boxes.  I'm working on a way around that, however.
  304.  
  305.     Standard Disclaimer.  It works here.  Don't screw up, and it'll work there.
  306.  
  307.     I hope you like it.  If you want to see it in operation first, feel free to
  308. call The Trading Post [SOUTH] and check it out.  I'm ASV, so you'll have
  309. full access on your first call.  (shameless plug)
  310.  
  311.     If you do use this mod, please drop me a line at 1@8315
  312. WWIVNet/Icenet/Solarnet/Woofnet and let me know.
  313.  
  314.     Oh yeah, revenge is sweet.  Also drop a note to 1@1100 and say "Nyah"
  315.  
  316.                             Morgul
  317. 1
  318. 27─────────────═════════════ 1T2he 1T2rading 1P2ost 7[1SOUTH7] ═════════════──────────────0
  319. 31Columbia, S.C. 2- 5(803) 731-0690 2-3 USR DS 16.8 2- 1WOMRable7 2- 3ASV 2- 7Icenet Support0
  320. 47          5WWIVNet7/3AdventNet7/4ICENet7/2SOLARNet 1@28315 6-1 FidoNet 21:376/126 0
  321. 5
  322.